package zp.demo.apitest.controller;


import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import zp.demo.apitest.listener.apiconfig.ApiProperties;


@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class TestApi {
    final ApiProperties apiProperties;
    /**
     * 测试接口1
     * @return
     */
    @RequestMapping("api/v1")
    @PostMapping
    public String test1()
    {
        return "测试接口1";
    }
    /**
     * 测试接口1
     * @return
     */
    @GetMapping("api/{id}/v2")
    public String test1(@PathVariable String id)
    {

        return "测试接口2";
    }
    /**
     * 根据配置获取系统api信息
     * @return
     */
    @GetMapping("api/list")
    public ApiProperties 接口信息列表()
    {

        return apiProperties;
    }

}
